home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
bipl.zip
/
PROCS.ZIP
/
FACTORL.ICN
< prev
next >
Wrap
Text File
|
1992-09-28
|
736b
|
34 lines
############################################################################
#
# File: factorl.icn
#
# Subject: Procedure for computing factorials
#
# Author: Ralph E. Griswold
#
# Date: September 6, 1992
#
###########################################################################
#
# factorl(n) returns n! It fails if n is less than 0
#
############################################################################
#
# Requires: Large-integer arithmetic except for small values of n
#
############################################################################
procedure factorl(n)
n := integer(n) | fail
if n < 0 then fail
i := 1
every i *:= 1 to n
return i
end